3.3 \(\int \frac{\tan ^2(x)}{a+a \csc (x)} \, dx\)

Optimal. Leaf size=39 \[ -\frac{x}{a}-\frac{\tan ^3(x) (1-\csc (x))}{3 a}+\frac{\tan (x) (3-2 \csc (x))}{3 a} \]

[Out]

-(x/a) + ((3 - 2*Csc[x])*Tan[x])/(3*a) - ((1 - Csc[x])*Tan[x]^3)/(3*a)

________________________________________________________________________________________

Rubi [A]  time = 0.0785335, antiderivative size = 39, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.231, Rules used = {3888, 3882, 8} \[ -\frac{x}{a}-\frac{\tan ^3(x) (1-\csc (x))}{3 a}+\frac{\tan (x) (3-2 \csc (x))}{3 a} \]

Antiderivative was successfully verified.

[In]

Int[Tan[x]^2/(a + a*Csc[x]),x]

[Out]

-(x/a) + ((3 - 2*Csc[x])*Tan[x])/(3*a) - ((1 - Csc[x])*Tan[x]^3)/(3*a)

Rule 3888

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Dist[a^(2*n
)/e^(2*n), Int[(e*Cot[c + d*x])^(m + 2*n)/(-a + b*Csc[c + d*x])^n, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && E
qQ[a^2 - b^2, 0] && ILtQ[n, 0]

Rule 3882

Int[(cot[(c_.) + (d_.)*(x_)]*(e_.))^(m_)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> -Simp[((e*Cot[c
+ d*x])^(m + 1)*(a + b*Csc[c + d*x]))/(d*e*(m + 1)), x] - Dist[1/(e^2*(m + 1)), Int[(e*Cot[c + d*x])^(m + 2)*(
a*(m + 1) + b*(m + 2)*Csc[c + d*x]), x], x] /; FreeQ[{a, b, c, d, e}, x] && LtQ[m, -1]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int \frac{\tan ^2(x)}{a+a \csc (x)} \, dx &=\frac{\int (-a+a \csc (x)) \tan ^4(x) \, dx}{a^2}\\ &=-\frac{(1-\csc (x)) \tan ^3(x)}{3 a}+\frac{\int (3 a-2 a \csc (x)) \tan ^2(x) \, dx}{3 a^2}\\ &=\frac{(3-2 \csc (x)) \tan (x)}{3 a}-\frac{(1-\csc (x)) \tan ^3(x)}{3 a}+\frac{\int -3 a \, dx}{3 a^2}\\ &=-\frac{x}{a}+\frac{(3-2 \csc (x)) \tan (x)}{3 a}-\frac{(1-\csc (x)) \tan ^3(x)}{3 a}\\ \end{align*}

Mathematica [A]  time = 0.108222, size = 62, normalized size = 1.59 \[ -\frac{-2 \sin (x)+4 \cos (2 x)+(6 x-5) (\sin (x)+1) \cos (x)}{6 a \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right ) \left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right )^3} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[x]^2/(a + a*Csc[x]),x]

[Out]

-(4*Cos[2*x] - 2*Sin[x] + (-5 + 6*x)*Cos[x]*(1 + Sin[x]))/(6*a*(Cos[x/2] - Sin[x/2])*(Cos[x/2] + Sin[x/2])^3)

________________________________________________________________________________________

Maple [A]  time = 0.048, size = 64, normalized size = 1.6 \begin{align*} -2\,{\frac{\arctan \left ( \tan \left ( x/2 \right ) \right ) }{a}}+{\frac{2}{3\,a} \left ( \tan \left ({\frac{x}{2}} \right ) +1 \right ) ^{-3}}-{\frac{1}{a} \left ( \tan \left ({\frac{x}{2}} \right ) +1 \right ) ^{-2}}-{\frac{3}{2\,a} \left ( \tan \left ({\frac{x}{2}} \right ) +1 \right ) ^{-1}}-{\frac{1}{2\,a} \left ( \tan \left ({\frac{x}{2}} \right ) -1 \right ) ^{-1}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(x)^2/(a+a*csc(x)),x)

[Out]

-2/a*arctan(tan(1/2*x))+2/3/a/(tan(1/2*x)+1)^3-1/a/(tan(1/2*x)+1)^2-3/2/a/(tan(1/2*x)+1)-1/2/a/(tan(1/2*x)-1)

________________________________________________________________________________________

Maxima [B]  time = 1.46338, size = 127, normalized size = 3.26 \begin{align*} -\frac{2 \,{\left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac{6 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - \frac{3 \, \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} + 2\right )}}{3 \,{\left (a + \frac{2 \, a \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac{2 \, a \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} - \frac{a \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}}\right )}} - \frac{2 \, \arctan \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)^2/(a+a*csc(x)),x, algorithm="maxima")

[Out]

-2/3*(sin(x)/(cos(x) + 1) - 6*sin(x)^2/(cos(x) + 1)^2 - 3*sin(x)^3/(cos(x) + 1)^3 + 2)/(a + 2*a*sin(x)/(cos(x)
 + 1) - 2*a*sin(x)^3/(cos(x) + 1)^3 - a*sin(x)^4/(cos(x) + 1)^4) - 2*arctan(sin(x)/(cos(x) + 1))/a

________________________________________________________________________________________

Fricas [A]  time = 0.47755, size = 123, normalized size = 3.15 \begin{align*} -\frac{3 \, x \cos \left (x\right ) + 4 \, \cos \left (x\right )^{2} +{\left (3 \, x \cos \left (x\right ) - 1\right )} \sin \left (x\right ) - 2}{3 \,{\left (a \cos \left (x\right ) \sin \left (x\right ) + a \cos \left (x\right )\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)^2/(a+a*csc(x)),x, algorithm="fricas")

[Out]

-1/3*(3*x*cos(x) + 4*cos(x)^2 + (3*x*cos(x) - 1)*sin(x) - 2)/(a*cos(x)*sin(x) + a*cos(x))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \frac{\int \frac{\tan ^{2}{\left (x \right )}}{\csc{\left (x \right )} + 1}\, dx}{a} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)**2/(a+a*csc(x)),x)

[Out]

Integral(tan(x)**2/(csc(x) + 1), x)/a

________________________________________________________________________________________

Giac [A]  time = 1.31879, size = 66, normalized size = 1.69 \begin{align*} -\frac{x}{a} - \frac{1}{2 \, a{\left (\tan \left (\frac{1}{2} \, x\right ) - 1\right )}} - \frac{9 \, \tan \left (\frac{1}{2} \, x\right )^{2} + 24 \, \tan \left (\frac{1}{2} \, x\right ) + 11}{6 \, a{\left (\tan \left (\frac{1}{2} \, x\right ) + 1\right )}^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(x)^2/(a+a*csc(x)),x, algorithm="giac")

[Out]

-x/a - 1/2/(a*(tan(1/2*x) - 1)) - 1/6*(9*tan(1/2*x)^2 + 24*tan(1/2*x) + 11)/(a*(tan(1/2*x) + 1)^3)